set nu
set linebreak
set textwidth=80
set nocompatible
set history=500
set ruler
set mouse=nv   "支持鼠标
set autochdir
set hlsearch
set noincsearch
set expandtab " 定义tab的空格宽度
set noerrorbells
set novisualbell
set foldmethod=marker
set tabstop=4
set shiftwidth=4
set nobackup
set nowritebackup
set smarttab
set smartindent
set autoindent
set wrap
set backspace=2
set autoread
set cmdheight=1
set showtabline=2 
set noswapfile
set clipboard+=unnamed
set tabpagemax=20
set laststatus=2
filetype on
filetype plugin on
filetype indent on
syntax on
set cscopequickfix=s-,c-,d-,i-,t-,e-

" set tags=~/debian-source/tags

" set cindent
" set the plug_in
" set t_vb= close visual bell

let Tlist_Show_One_File = 1            " 不同时显示多个文件的tag，只显示当前文件的
let Tlist_Exit_OnlyWindow = 1          " 如果taglist窗口是最后一个窗口，则退出vim
let Tlist_Use_Right_Window = 0        " 在右侧窗口中显示taglist窗口


set fencs=utf-8,ucs-bom,gb18030,gbk,gb2312,cp936
nnoremap <silent><F4> :TlistToggle<CR>
set pastetoggle=<F9>


 "NERD Tree
let NERDChristmasTree=1
let NERDTreeAutoCenter=1
"let NERDTreeBookmarksFile=$VIM.'\Data\NerdBookmarks.txt'
let NERDTreeMouseMode=2
let NERDTreeShowBookmarks=1
let NERDTreeShowFiles=1
let NERDTreeShowHidden=1
let NERDTreeShowLineNumbers=1
let NERDTreeWinPos='right'
let NERDTreeWinSize=31
nnoremap <silent><F3> :NERDTreeToggle<CR>


" :cs add /home/mm/linux-2.6.32/cscope.out /home/mm/linux-2.6.32/ 

let NERDSpaceDelims=1       " 让注释符与语句之间留一个空格
let NERDCompactSexyComs=1   " 多行注释时样子更好看


" plugin - NeoComplCache.vim    自动补全插件

let g:neocomplcache_enable_at_startup=1 
let g:NeoComplCache_SmartCase = 1
let g:NeoComplCache_TagsAutoUpdate = 1
let g:NeoComplCache_EnableInfo = 1
let g:NeoComplCache_EnableCamelCaseCompletion = 1
let g:NeoComplCache_MinSyntaxLength = 3
let g:NeoComplCache_EnableSkipCompletion = 1
let g:NeoComplCache_SkipInputTime = '0.5'
let g:NeoComplCache_SnippetsDir = $VIMFILES.'/snippets'


" <TAB> completion.
inoremap <expr> <TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
" snippets expand key
imap <silent> <C-e> <Plug>(neocomplcache_snippets_expand)
smap <silent> <C-e> <Plug>(neocomplcache_snippets_expand)


"set foldenable              " 开始折叠
"set foldmethod=syntax       " 设置语法折叠
"set foldcolumn=0            " 设置折叠区域的宽度
"setlocal foldlevel=1        " 设置折叠层数为
"set foldclose=all     	    " 设置为自动关闭折叠                            
nnoremap <space> @=((foldclosed(line('.')) < 0) ? 'zc' : 'zo')<CR>
                            " 用空格键来开关折叠

" key stock
" set cursorline

map <F12> :q!<cr> 


"让vim记忆上次编辑的位置
autocmd BufReadPost *
		\ if line("'\"")>0&&line("'\"")<=line("$") |
		\	exe "normal g'\"" |
		\ endif
"让vim记忆上次编辑的位置
